package com.teddy.model;

import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.Writer;

import com.teddy.model.abstracts.SemanticObject;

public class Serializer {
	
	public static void serializeModel(SemanticObject so){
		try {
			
			PrintStream ps = null;
		      ps = new PrintStream(new FileOutputStream(so.getURI()));
		      Writer modelWriter = new OutputStreamWriter(ps, "UTF-8");
			//Writer modelWriter = new FileWriter(so.getURI());
			so.getModel().write(modelWriter, so.getFormat());
	//		Writer dcWriter = new FileWriter(so.getDcUri());
//			so.getDcModel().write(dcWriter, Constants.RDF_XML_FORMAT);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
